<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>流转定义管理</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
function setupCondition(transType){
	if (transType == 'auto'){
		$('#transExpTr').hide();
	}
	else if (transType == 'cond'){
		$('#transExpTr').show();		
	}
}
function saveRequest(){
	postRequest('form1',{actionType:'save',onComplete:function(responseText){
		if ("fail" != responseText){
			var obj = $.parseJSON(responseText);
			var id = obj.id;			
			var name = obj.name;			
			parent.setLineText(name);
			parent.PopupBox.closeCurrent();
			parent.window.focus();
			parent.document.body.focus();			
		}
	}});
}
function autoFill(){
	$("#WFT_NAME").val("TO"+$("#toNodeName").val());
}
function clearText(){
	$("#WFT_NAME").val("");
}
function closeBox(){
	parent.PopupBox.closeCurrent();
	parent.window.focus();
	parent.document.body.focus();
}
</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ParamBar__" style="float: right;">&nbsp;</div>
<div id="__ToolBar__">
<table border="0" cellpadding="0" cellspacing="1">
<tr height="24px;">
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" align="center" onClick="saveRequest()"><input value="&nbsp;" type="button" class="saveImgBtn" id="saveImgBtn" title="保存" />保存</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" align="center" onClick="closeBox()"><input value="&nbsp;" type="button" class="closeImgBtn" title="关闭" />关闭</td>
</tr>
</table>
</div>
<table class="detailTable" cellspacing="0" cellpadding="0">
<tr>
	<th width="100" nowrap>起止节点</th>
	<td><%=pageBean.labelValue("transName")%></td>
</tr>
<tr>
	<th width="100" nowrap>编码</th>
	<td><input name="WFT_CODE" type="text" class="text" id="WFT_CODE" value="<%=pageBean.inputValue("WFT_CODE")%>" size="24" readonly="readonly" /></td>
</tr>
<tr>
	<th width="100" nowrap>名称</th>
	<td>
      <input id="WFT_NAME" name="WFT_NAME" type="text" value="<%=pageBean.inputValue("WFT_NAME")%>" size="24" class="text" />
	  <input type="button" name="button" id="button" value="生成" onclick="autoFill()" />
	  <input type="button" name="button2" id="button2" value="清空" onclick="clearText()" />
    </td>
</tr>
<tr>
	<th width="100" nowrap>流转类型</th>
	<td>
	  <input type="radio" name="TRANS_TYPE" id="radio1" value="auto" <%=pageBean.checked("auto".equals(pageBean.inputValue("TRANS_TYPE")))%> onclick="setupCondition(this.value)" />
	  自动流转&nbsp;&nbsp;&nbsp;&nbsp;
	  <input type="radio" name="TRANS_TYPE" id="radio2" value="cond" <%=pageBean.checked("cond".equals(pageBean.inputValue("TRANS_TYPE")))%> onclick="setupCondition(this.value)" />
	  条件流转</td>
</tr>
<tr id="transExpTr">
  <th width="100" nowrap>表达式</th>
  <td><textarea style="width:400px;" name="TRANS_EXPRESSION" rows="6" class="textarea" id="TRANS_EXPRESSION" ><%=pageBean.inputValue("TRANS_EXPRESSION")%></textarea><img class="varselecter" src="images/varselecter.png" width="20" height="20" onclick="showVariableBox('TRANS_EXPRESSION')" style="cursor:pointer" /></td>
</tr>
</table>
<input type="hidden" name="toNodeName" id="toNodeName" value="<%=pageBean.inputValue("toNodeName")%>"/>
<input type="hidden" name="fromNodeName" id="fromNodeName" value="<%=pageBean.inputValue("fromNodeName")%>"/>
<input type="hidden" name="actionType" id="actionType" value=""/>
<input type="hidden" id="WFT_ID" name="WFT_ID" value="<%=pageBean.inputValue("WFT_ID")%>" />
<jsp:include page="/jsp/inc/varselecter.inc.jsp" flush="true" />
</form>
<script language="javascript">
//initDetailOpertionImage();
setupCondition('<%=pageBean.inputValue("TRANS_TYPE")%>');
</script>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
